package com.ruoyi.mall.app.controller;

import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.mall.app.service.DtsSeckillBatchService;
import com.ruoyi.mall.common.domain.DtsSeckillBatch;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

// 秒杀
@RestController
@RequestMapping("/api/index/seckillBath")
public class DtsSeckillBathController extends BaseController {

    @Autowired
    private DtsSeckillBatchService dtsSeckillBatchService;

    @GetMapping("/seckillBathList")
    public AjaxResult seckillBathList(DtsSeckillBatch dtsSeckillBatch) {
        return success(dtsSeckillBatchService.selectDtsSeckillBathList(dtsSeckillBatch));
    }

    // 获取全部秒杀商品
    @GetMapping("/seckillGoods")
    public AjaxResult seckillGoods() {
        return success(dtsSeckillBatchService.selectSeckillandGoods());
    }

    // 取场次
    @GetMapping("/getSeckillBatch")
    public AjaxResult getSeckillBatch() {
        return success(dtsSeckillBatchService.selectSeckillTime());
    }
}
